﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SaleOfMoviesSystem.Sqlite.Models
{
    public class Movie
    {
        [Required]
        [MaxLength(255)]
        [Key]
        public string MovieName { get; set; }

        [Required]
        public decimal Price { get; set; }

        [Required]
        public decimal Discount { get; set; }

        public double Grade { get; set; }
        public string Directors { get; set; }
        public string MainPlayers { get; set; }
        public string Duration { get; set; }
        public string ImgPath { get; set; }
        public string Description { get; set; }

        public List<MovieTime> MovieTimes { get; set; } = new List<MovieTime>();

        public Image Img
        {
            get
            {
                if (File.Exists(ImgPath))
                    return Image.FromFile(ImgPath);
                return null;
            }
        }

        //public Cinema Cinema { get; set; }
    }
}